package com.ys.enume;

import org.apache.commons.lang3.StringUtils;

/**
 * @EnumName 亚马逊卖家中心 url
 * @Description TODO
 * @Author alula
 * @Date 2022-12-01 15:48
 */
public enum AmazonSellerEnum {
    //北美
    CA("Amazon.ca", RegionEnum.NORTH.getCode(), "Canada", "加拿大", "https://sellercentral.amazon.ca"),
    US("Amazon.com", RegionEnum.NORTH.getCode(), "United States", "美国", "https://sellercentral.amazon.com"),
    MX("Amazon.com.mx", RegionEnum.NORTH.getCode(), "Mexico", "墨西哥", "https://sellercentral.amazon.com.mx"),
    BR("BR", RegionEnum.NORTH.getCode(), "Brazil", "巴西", "https://sellercentral.amazon.com.br"),

    //欧洲
    ES("Amazon.es", RegionEnum.EUROPE.getCode(), "Spain", "西班牙", "https://sellercentral-europe.amazon.com"),
    GB("Amazon.co.uk", RegionEnum.EUROPE.getCode(), "United Kingdom", "英国", "https://sellercentral-europe.amazon.com"),
    FR("Amazon.fr", RegionEnum.EUROPE.getCode(), "France", "法国", "https://sellercentral-europe.amazon.com"),
    NL("Amazon.nl", RegionEnum.EUROPE.getCode(), "Netherlands", "荷兰", "https://sellercentral.amazon.nl"),
    DE("Amazon.de", RegionEnum.EUROPE.getCode(), "Grmany", "德国", "https://sellercentral-europe.amazon.com"),
    IT("Amazon.it", RegionEnum.EUROPE.getCode(), "Italy", "意大利", "https://sellercentral-europe.amazon.com"),
    SE("Amazon.se", RegionEnum.EUROPE.getCode(), "Sweden", "瑞典", "https://sellercentral.amazon.se"),
    PL("Amazon.pl", RegionEnum.EUROPE.getCode(), "Poland", "波兰", "https://sellercentral.amazon.pl"),
    EG("EG", RegionEnum.EUROPE.getCode(), "Egypt", "埃及", "https://sellercentral.amazon.eg"),
    TR("Amazon.com.tr", RegionEnum.EUROPE.getCode(), "Turkey", "土尔其", "https://sellercentral.amazon.com.tr"),
    SA("SA", RegionEnum.EUROPE.getCode(), "Saudi Arabia", "沙特阿拉伯", "https://sellercentral.amazon.com.sa"),
    AE("AE", RegionEnum.EUROPE.getCode(), "United Arab Emirates", "阿拉伯联合酋长国", "https://sellercentral.amazon.ae"),
    IN("IN", RegionEnum.EUROPE.getCode(), "India", "印度", "https://sellercentral.amazon.in"),
    BE("Amazon.com.be", RegionEnum.EUROPE.getCode(), "Belgium", "比利时", "https://sellercentral-europe.amazon.com"),

    //远东
    SG("SG", RegionEnum.ASIA.getCode(), "Singapore", "新加坡", "https://sellercentral.amazon.sg"),
    AU("AU", RegionEnum.ASIA.getCode(), "Australia", "澳大利亚", "https://sellercentral.amazon.com.au"),
    JP("JP", RegionEnum.ASIA.getCode(), "Japan", "日本", "https://sellercentral-japan.amazon.com"),
    ;


    private final String code;

    private final String site;

    private final String enName;

    private final String cnName;

    private final String sellerCenterUrl;

    AmazonSellerEnum(String code, String site, String enName, String cnName, String sellerCenterUrl) {
        this.code = code;
        this.site = site;
        this.enName = enName;
        this.cnName = cnName;
        this.sellerCenterUrl = sellerCenterUrl;
    }

    public static AmazonSellerEnum getEnum(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        for (AmazonSellerEnum countryEnum : AmazonSellerEnum.values()) {
            if (countryEnum.getCode().equals(code)) {
                return countryEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getSite() {
        return site;
    }

    public String getEnName() {
        return enName;
    }

    public String getCnName() {
        return cnName;
    }

    public String getSellerCenterUrl() {
        return sellerCenterUrl;
    }
}
